import React from 'react';
import store from 'store'
import { withRouter, Redirect } from 'react-router-dom'
import { Toast } from 'antd-mobile'

class IsOneStar extends React.PureComponent {
    render() {
        if (store.get('user').level >= 1) {
            return this.props.children
        } else {
            return Toast.info('您当前级别暂未达到一星，无法认证', 2, () => {
                <Redirect to="/center" />
            })
        }
    }
}

export default withRouter(IsOneStar)